package com.sat.goods.config;

import com.sat.goods.model.SkuVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 *定义feign，将good服务下的foods/getBySkuId/{skuId}对外访问
 */
@FeignClient("goods")//调用的服务名
@RequestMapping("goods")//controller的访问路径
public interface SkuFeign {
    //需要对外的controller
    @GetMapping("getBySkuId/{skuId}")
    public SkuVo getBySkuId(@PathVariable Long skuId);

    @RequestMapping("updateInventory")
    public Integer updateInventory(@RequestParam("skuId") String skuId ,@RequestParam("num") Integer num);
}
